﻿@model Associativy.Frontends.Models.IGraphAspect
           
@{
    Script.Require("AssociativyFrontends_Dracula").AtFoot();
    Style.Require("AssociativyFrontends_Dracula");

    var addNodesShape = ((dynamic)ShapeFactory).DisplayTemplate(
                            TemplateName: "Pages/Frontends/Engines/Dracula/AddNodes",
                            Model: Model,
                            Prefix: null);

    var addEdgesShape = ((dynamic)ShapeFactory).DisplayTemplate(
                            TemplateName: "Pages/Frontends/Engines/Dracula/AddEdges",
                            Model: Model,
                            Prefix: null);
}

@using (Script.Foot())
{
    <script type="text/javascript">
    (function ($) {
        $(function(){
	        var graph = new Graph();

            @Display(addNodesShape)

            @Display(addEdgesShape)
	
	        var layouter = new Graph.Layout.Spring(graph);
	        layouter.layout();
	 
	        var renderer = new Graph.Renderer.Raphael("associativy-dracula-canvas", graph, $("#associativy-dracula-canvas").width(), $("#associativy-dracula-canvas").height());
	        renderer.draw();
        });
    })(jQuery);
    </script>
}

<div id="associativy-dracula-canvas" class="associativy-graph-canvas">
</div>